<?php include_once("db_config.php");?>
<!DOCTYPE>
<html lang="<?php echo $lang;?>">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="renderer" content="webkit">
        <meta name="description" content="向日葵后台管理">
        <meta name="keywords" content="向日葵电脑">
        <meta name="author" content="ysfl">
        <meta name="robots" content="index,follow">
        <link rel="icon" href="img/favicon.ico">
        <title>向日葵电脑后台管理登录页面</title>
        <!--[if lte IE 8]>
        <style type="text/css">
            html,body{width:100%; height:100%; overflow:scroll}
            .section-btn{display:none;}
        </style>
        <![endif]-->
        <!-- Bootstrap core CSS -->
        <script src="js/jquery.min.js"></script>
        <script src="js/jquery.function.js"></script>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <style type="text/css">
        .main{
            width: auto;
            height: 360px;
            border: 1px solid rgba(71, 173, 153, 0.25);
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
            margin: 40% auto;
        }
        .login_form{
            margin:-4px auto ;
            width: auto;
            text-align: center;
        }
        .input-cent{
            margin: 0 auto;
            text-align: center;
        }
        .login_form .input-group{
            margin: 5px 20% 0 20%;
            width: 100%;
        }
        .input-group-addon{
            color: rgb(5, 139, 150);
        }
        .form-control{
            width: 200px!important;
        }
        .userinfo{
            float: right;
              margin: -60 1 0 0;
        }
        .logoutinfo{
            float: right;
              margin: -100 1 0 0;
        }
        .login_err{
            margin:10px auto;
            width: 200px;
            text-align: center;
        }
        body{
            background: url("./img/bg3.jpg") fixed center center no-repeat;
        }
        h1{
            color:rgba(224, 236, 193, 0.79);
        }
        h1 small{
            color:rgba(0, 245, 255, 0.79);
        }
        </style>
    </head>
<body>
    <div class="main">
    <div class="page-header">
    <?php 
        session_start();
        if(!isset($_SESSION["userid"])){
        echo '
        <h1>向日葵电脑内部管理系统<small> - Welcome to sun</small></h1>
    </div>
    <div id="login-info">
            <form class="navbar-form login_form" role="form">
            <div class="input-cent">
                <span class="input-group">
                    <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
                    <input type="text" placeholder="用户名" class="form-control" id="login-username">
                </span>
                <span class="input-group">
                    <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
                    <input type="password" placeholder="密码" class="form-control" id="login-password">
                </span>
                </div>
                <button type="button" style="margin-top: 5px;" class="btn btn-primary" onclick="login();"><span class="glyphicon glyphicon-ok"></span> 登录</button>
            </form>
            <div class="alert alert-info login_err" role="alert">请输入账号密码！</div>
            ';}
        else {
            echo '
            <h1>尊敬的<b style="color:rgb(0, 255, 197);"> '.$_SESSION["username"].' </b>欢迎回来！<small></small></h1>
    </div>
    <div id="login-info">
            <div class="alert alert-info login_err" role="alert">你已经登陆了！<a href="./admin/" class="btn btn-primary btn-xs">进入后台</a></div>
            ';
        }
        ?>
        </div>
    </div>
</body>
</html>